package com.inspectortime.domain;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;

import com.inspectortime.common.Identifiable;
import com.inspectortime.domain.pricing.FeeCalculator;
import com.inspectortime.domain.pricing.PriceAdjusterException;
import com.inspectortime.domain.pricing.PricingPlanType;
import com.inspectortime.domain.type.Address;

public interface InspectorCompany extends Identifiable {

	void addInspector(Inspector inspector);

	void addScheduler(Scheduler obj);
	
	double calculateInspectionFee(Inspection inspection)
	throws PriceAdjusterException;

	FeeCalculator findFeeCalculatorById(String id);

	List<Inspection> findInspectionsBetween(Date start, Date end);

	OptionalService findOptionalServiceById(String id);

	List<EmailTemplate> getEmailTemplates();
	
	Address getAddress();

	double getBaseInspectionFee();

	String getDistanceInMilesCenterZip();

	double getDistanceInMilesFeeIncreasePerMile();

	int getDistanceInMilesLimit();

	Collection<User> getEmployees();

	List<FeeCalculator> getFeeCalculators();

	Collection<Inspector> getInspectors();

	int getMaxMilesServed();

	String getName();

	List<OptionalService> getOptionalServices();

	PricingPlanType getPricingPlanType();

	/**
	 * 
	 * @return
	 */
	String getRecipientToken();

	Collection<RealEstateAgent> getReferringAgents();

	/**
	 * 
	 * @return
	 */
	String getRefundToken();

	Collection<Scheduler> getSchedulers();

	String getShortName();

	String getSimLoginId();

	String getSimTransactionKey();

	void removeFeeCalculator(String id);

	void removeOptionalService(String id);

	void setAddress(Address address);

	void setBaseInspectionFee(double fee);

	void setDistanceInMilesCenterZip(String distanceInMilesCenterZip);

	void setDistanceInMilesFeeIncreasePerMile(
			double distanceInMilesFeeIncreasePerMile);

	void setDistanceInMilesLimit(int distanceInMilesLimit);

	void setFeeCalculators(List<FeeCalculator> a);
	
	void setEmailTemplates(List<EmailTemplate> a);

	void setMaxMilesServed(int milesServed);

	void setName(String name);

	void setPricingPlanType(PricingPlanType pricingPlanType);

	/**
	 * 
	 * @param recipientToken
	 */
	void setRecipientToken(String recipientToken);

	/**
	 * 
	 * @param refundToken
	 */
	void setRefundToken(String refundToken);

	void setShortName(String shortName);

	void setSimLoginId(String simLoginId);

	void setSimTransactionKey(String simTransactionKey);

	byte[] getLogoImage();
	void setLogoImage(byte[] logoFile);
	void readLogoImageFrom(InputStream in) throws IOException;
	void writeLogoImageTo(OutputStream out) throws IOException;
	
	boolean isPaypalEnabled();

	void setPaypalEnabled(boolean paymentEnabled);

	@Column(length = 100)
	String getPaypalPaymentEmail();	
	void setPaypalPaymentEmail(String paymentEmail);
	
}
